Skip to content

Proclaim return types and other fixes needed for CCCL 3.2#5375

Merged
gforsyth merged 5 commits intorapidsai:mainfrom
bdice:proclaim-return-types
Dec 18, 2025
Merged

Proclaim return types and other fixes needed for CCCL 3.2#5375
gforsyth merged 5 commits intorapidsai:mainfrom
bdice:proclaim-return-types

Conversation

@bdice
Copy link
Contributor

@bdice bdice commented Dec 17, 2025

Fixes needed for CCCL 3.2 compatibility.

@bdice bdice requested a review from a team as a code owner December 17, 2025 01:24
@bdice bdice added improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Dec 17, 2025
@bdice bdice force-pushed the proclaim-return-types branch from b53929b to 9463815 Compare December 18, 2025 06:53
@bdice bdice changed the title Proclaim return types Proclaim return types and other fixes needed for CCCL 3.2 Dec 18, 2025
std::vector<size_t> h_distance_offsets(global_max_distance + 1);
// Need global_max_distance + 2 elements: one for each distance level (0 to global_max_distance)
// plus a sentinel at the end for CUB segmented sort end offsets
std::vector<size_t> h_distance_offsets(global_max_distance + 2);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be an off-by-one error that results in an illegal memory access in SortPairs.

Comment on lines -876 to +882
// Process each chunk - sort consecutive arrays directly in-place
// Allocate output buffers for CUB sort (input/output cannot overlap)
rmm::device_uvector<vertex_t> sorted_vertices(total_vertices, handle.get_stream());
rmm::device_uvector<origin_t> sorted_sources(total_vertices, handle.get_stream());
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests were failing so I was investigating this file, and I think this comment points to a violation of the CUB API preconditions. The inputs and outputs of the cub::DeviceSegmentedSort::SortPairs call overlapped. See the docs for cub::DeviceSegmentedSort::SortPairs.

As a workaround, I am initializing an output buffer for the sorted results, and then moving it back to the original variable once computation is complete.

Copy link
Member

@alexbarghi-nv alexbarghi-nv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved but should be re-reviewed by @ChuckHastings or @seunghwak when they're back from vacation.

@bdice
Copy link
Contributor Author

bdice commented Dec 18, 2025

Thanks! I agree -- these should be reviewed more but I don't want to break cuGraph with the CCCL 3.2 update. Thanks for taking a look and discussing offline @alexbarghi-nv and @rlratzel.

@gforsyth gforsyth merged commit 3e2bf4a into rapidsai:main Dec 18, 2025
98 of 102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants